function addCallback(socket,newChatCallback=()=>{}, listRefreshCallback=()=>{},talkDetailRefreshCallback=()=>{},onTalkWithMsgCallback=()=>{}) {
  if(!newChatCallback instanceof Function || !listRefreshCallback instanceof Function || !talkDetailRefreshCallback instanceof Function){
    console.log('必须传入函数')
    return
  }
  let newChatAlert = (data) => {
    newChatCallback(data)
    console.log(data,"新消息")
  };
  let listRefresh = (data) => {
    listRefreshCallback(data)
    console.log(data, "列表刷新");
  };
  let talkDetailRefresh = (data) => {
    talkDetailRefreshCallback(data)
    console.log(data, "会话详情刷新");
  };
  let onTalkWithMsg = (data)=>{
    onTalkWithMsgCallback(data)
    console.log(data, '新消息2')
  }
  socket.addTalkObjectCallback(
    newChatAlert,
    listRefresh,
    talkDetailRefresh,
    onTalkWithMsg
  );
}
export default addCallback